package com.billdowney.entity.system;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Type;

import com.billdowney.entity.base.BaseEntityIdByUUIDHex;

import io.swagger.annotations.ApiModelProperty;

/**
 * @ClassName: SystemDataDictionary
 * @Description: 系统数据字典表
 * @author 超级小富翁 - BillDowney
 * @date 2018年3月7日 下午11:50:09
 */
@Entity
@Table(name = "system_data_dict")
public class SystemDataDict extends BaseEntityIdByUUIDHex {

	private static final long serialVersionUID = 1L;
	@ApiModelProperty(value = "名称")
	@Column(length = 30)
	private String name;
	@ApiModelProperty(value = "键值", notes = "可以根据该值来查找数据，该值必须唯一")
	@Column(length = 50)
	private String keyName;
	@ApiModelProperty(value = "内容", notes = "内容长度不受限制")
	@Type(type = "text")
	private String content;
	@ApiModelProperty(value = "优先级", notes = "优先级越高，越靠前")
	private int priority;
	@ApiModelProperty(value = "描述")
	@Column(length = 100)
	private String description;

	@ManyToOne(targetEntity = SystemDirectory.class, fetch = FetchType.LAZY)
	@JoinColumn(name = "systemDirectory_id")
	@ApiModelProperty(value = "字典目录信息")
	private SystemDirectory systemDirectory;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getKeyName() {
		return keyName;
	}

	public void setKeyName(String keyName) {
		this.keyName = keyName;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public int getPriority() {
		return priority;
	}

	public void setPriority(int priority) {
		this.priority = priority;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public SystemDirectory getSystemDataDictionaryDirectory() {
		return systemDirectory;
	}

	public void setSystemDataDictionaryDirectory(SystemDirectory systemDirectory) {
		this.systemDirectory = systemDirectory;
	}

	@Override
	public String toString() {
		return "SystemDataDict [name=" + name + ", keyName=" + keyName + ", content=" + content + ", priority="
				+ priority + ", description=" + description + "]";
	}

}
